package mobi.hami.huapin.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import mobi.hami.huapin.base.Result;
import mobi.hami.huapin.service.NoteThumbUpLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 纸条相关Controller
 * Create by 子龙 on 2018/9/11
 */
@RestController
@RequestMapping(value = "/note", produces = "application/json")
@Api(description = "纸条相关api")
public class NoteController {


    @Autowired
    private NoteThumbUpLogService noteThumbUpLogService;

    /**
     * 对用户的帖纸条记录点赞
     * @param  userId 点赞人id
     * @param  noteId 用户被贴纸条记录id
     * @return Result
     */
    @RequestMapping(value = "/thumbup.do", method = RequestMethod.POST)
    @ApiOperation(value = "对用户的帖纸条记录点赞", notes = " ")
    @ApiImplicitParams(
            {
                    @ApiImplicitParam(name = "userId", value = "点赞人的id", example = "3000001", paramType = "query", required = true, dataType = "integer"),
                    @ApiImplicitParam(name = "noteId", value = "用户被贴纸条记录id", example = "1", paramType = "query", required = true, dataType = "integer"),
            }
    )
    public Result thumbup(Integer userId,Integer noteId){
        return noteThumbUpLogService.addNoteThumbUpLog(userId,noteId);
    }



}
